const express = require('express')

const fs = require('fs')

const app = express()

app.engine('html', require('express-art-template'))

app.set('view engine', 'html')

app.get('/', (req, res) => {
    res.render('hello.html')
})



app.get('/car', (req, res) => {
    // fs.readFile('student.html', (err, data) => {
    //     if(err){
    //         res.status(500).send('err 404')
    //         console.log(err+'文件读取失败404')
    //     }
    //     console.log('读取文件成功！')
    //     console.log(data.toString())
    // })
    console.log('有人请求服务器2了')
    res.render('car.html')
})

app.listen('5001', () => {
    console.log('server is running')
})
